﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.AspNetCore.Mvc.Rendering;

namespace Kugar.UI.Web.AdminLTE.PageControls.PageCommon
{
    public class PageCommon_Row:ContainerBase
    {
        public PageCommon_Row(ViewContext viewContext) : base(viewContext)
        {
        }

        public override void Dispose()
        {
            ViewContext.Writer.WriteLine($"</div>");

            if (_withOuterBorder)
            {
                ViewContext.Writer.WriteLine($"</div> <!-- outer border -->");
            }
        }

        internal override ContainerBase RenderInternal()
        {
            if (_withOuterBorder)
            {
                ViewContext.Writer.WriteLine($"<div class=\"{_outerBorderCss}\">");
            }

            ViewContext.Writer.WriteLine($"<div class=\"row {Attributes}\">");

            return this;
        }
    }
}
